package com.feng.study.service;

import com.google.common.collect.Maps;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.File;
import java.util.Map;

/**
 * @Author: Zeng ShaoYong
 * @Date: 2021-11-16
 * @Description:
 */
@Component
@Slf4j
//生成构造器，会将类的每一个final字段或者non-null字段生成一个构造方法
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ResultUpload {
    private final Map<String,UploadDemo> uploadDemoMap;

    //不用写@Autowired
    private final AsyncService asyncService;

    /**
     * 构造器
     */
//    public ResultUpload(Map<String, UploadDemo> uploadDemoMap) {
//        this.uploadDemoMap = uploadDemoMap;
//    }

    public static void main(String[] args) {

    }
    public void test() throws Exception {
        asyncService.asyncVoid();

        String str="A2UploadDemo";
        UploadDemo uploadDemo = uploadDemoMap.get(str);
        uploadDemo.upload(new File("aa"));
        System.out.println(11);
    }
}
